1. Field of the Invention
This invention pertains generally to MPEG-4/AVC video coding, and more particularly to reducing computational complexity of the quantization that is carried out in MPEG-4/AVC video coding.
2. Description of Related Art
MPEG-2 is currently the most widely used standard employed in compressing audio and visual (AV) digital data. At the same time, MPEG-4 is an emerging standard that typically provides a factor of two improvement in coding efficiency over MPEG-2. MPEG-4 is also variously known as MPEG-4 Part 10, JVT (for Joint Video Team), H.264, H.26L, or just AVC (for Advanced Video Coding). Although MPEG-4 provides a considerable coding gain, processing complexity, and associated computational overhead, are considerably increased.
An MPEG-4 encoder first applies the Discrete Cosine Transform (DCT) to the 4×4 or 8×8 block of the residue signal and then quantizes the DCT coefficients. In the MPEG-4 standard, each DCT coefficient has to be quantized using a quantization table and scaled with a value, which is stored in a scaling table at a position corresponding to the DCT coefficient. The scaling is computationally expensive due to the need for a division operation. The picture level quantization table scaling method pre-computes a new scaled quantization table using the quantization table and the scaling table, whereafter it transmits the new scaled quantization table to the quantization process.
In the MPEG-4 standard, the number of bits in MB_layer data for any given macroblock (MB) should not exceed a threshold specified in the AVC standard. If during an encoding process, the number of bits used by a MB exceeds the threshold, the MB must be re-encoded. To obtain an optimal result, multi-pass operation may be required which is computationally expensive.
To reduce processing complexity, researchers have primarily focused on the areas of fast motion estimation and fast mode decision. However, when fast motion estimation and mode decision algorithms are utilized, the complexity of quantization of the DCT coefficients becomes an important consideration.
In the AVC standard, a total of fifty-two values of Qstep are supported and indexed by a quantization parameter (QP). The Qstep increases by 12.5% for each increment of one in QP. The wide range of quantizer step sizes makes it possible for an encoder to accurately and flexibly control the trade-off between bit rate and quality. However, the implementation complexity is relatively high by the requirements of multiplication and shifting and incorporating the post-scaling and pre-scaling. In the standard, the following equation is used to quantize and scale a single coefficient by:
                              Z          ij                =                  round          ⁢                                          ⁢                      (                                                                                C                    ij                                    ·                                      W                    ⁡                                          (                                                                                                    MF                            ⁡                                                          [                                                              qp                                ⁢                                                                                                                                  ⁢                                %                                ⁢                                                                                                                                  ⁢                                6                                                            ]                                                                                ⁡                                                      [                            i                            ]                                                                          ⁡                                                  [                          j                          ]                                                                    )                                                                      +                f                                            2                quant_shift                                      )                                              (        1        )            where the scaling process can be conducted as following,
                              W          ⁡                      (                                                            MF                  ⁡                                      [                                          qp                      ⁢                                                                                          ⁢                      %                      ⁢                                                                                          ⁢                      6                                        ]                                                  ⁡                                  [                  i                  ]                                            ⁡                              [                j                ]                                      )                          =                  round          ⁢                                          ⁢                      (                                          16                ·                                                                            MF                      ⁡                                              [                                                  qp                          ⁢                                                                                                          ⁢                          %6                                                ]                                                              ⁡                                          [                      i                      ]                                                        ⁡                                      [                    j                    ]                                                                                                Scale                  ⁡                                      [                    i                    ]                                                  ⁡                                  [                  j                  ]                                                      )                                              (        2        )            and wherein MF is a multiplication factor table which will return different values based on the value of qp and position i and j, qp is quantization parameter, and f is quantization offset. That is equivalent to two multiplications, one division, one summation, one shifting and two table look-up operations for every single coefficient. Also, one condition checking operation and two other summations are required to obtain the number of zero coefficients and put signs on the quantized coefficients.
In the AVC standard, bitstreams conforming to any profile at a specified level should obey some constraints. Among them, one constraint is invariant to the profile and level, which is the maximum bits allowed in the macroblock layer data for any macroblock. This constraint is specified in Annex A3.1(n) in the AVC standard document. According to the standard in Annex A3.1(n), the number of bits of macroblock_layer( ) data for any macroblock does not exceed 3200. During the encoding process, if the number of bits used by a macroblock exceeds this threshold, then this macroblock needs to be re-encoded by using some adjustments, wherein the constraint is conformed. To obtain an optimal result, multi-pass encoding may be required. However, the complexity of such a multi-pass strategy typically renders doing so impractical.